class Student {
    constructor(public name: string, public age: number) {}
    
    getDetails() {
        return `${this.name} is ${this.age} years old.`;
    }
}

const student = new Student("John Doe", 20);
console.log(student.getDetails());